//
//  MHViewController.m
//  MHTextField
//
//  Created by Mehfuz Hossain on 12/3/13.
//  Copyright (c) 2013 Mehfuz Hossain. All rights reserved.
//

#import "MHViewController.h"
#import "JGAlertView.h"

@interface MHViewController () <JGAlertViewDelegate>

@property (nonatomic, strong) JGAlertView *aletView;

@end

@implementation MHViewController

-(JGAlertView *)aletView
{
    if (!_aletView) {
        self.aletView = [JGAlertView alertView];
        self.aletView.delegate = self;
        [self.view addSubview:self.aletView];
    }
    
    return _aletView;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
}


- (IBAction)showView:(id)sender {
    
    self.aletView.center = CGPointMake(self.view.frame.size.width * 0.5, -(self.view.frame.size.height * 0.5));
    
    [UIView animateWithDuration:0.2 animations:^{
        self.aletView.center = CGPointMake(self.view.frame.size.width * 0.5, self.view.frame.size.height * 0.5);
    }];
    
}

#pragma mark - JGAlertViewDelegate
-(void)jgAlertView:(JGAlertView *)alertView commitParams:(NSDictionary *)params
{
    NSLog(@"%@",params);
}


@end
